#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<cstring>
using namespace std;
const int N = 110, M = 5e4 + 10;
int w[N];
int p[N];
long long f[M];
int n, h;
int main()
{
    cin >> n >> h;
    for (int i = 1; i <= n; i++)
    {
        cin >> p[i] >> w[i];
    }
    memset(f, 0x3f3f3f3f, sizeof(f));
    f[0] = 0;
    for (int i = 1; i <= n; i++)
    {
        for (int j = 0; j <= h; j++)
        {
            f[j] = min(f[j], f[max(j - p[i], 0)] + w[i]);
        }
    }
    cout << f[h] << endl;
    return 0;
}